package com.example.demo.pojos;

import javax.persistence.*;
import java.util.Objects;

@Entity
public class Bjxqinfo {
    private int bjxqId;
    private String lxfs;
    private String jfsm;
    private String fksm;
    private String bzyssm;
    private String bz;
    private String spzt;
    private String spjl;
    private String fxs;
    private Bjinfo bj;
    private Contact jsr;
    private Contact bjr;

    @Id
    @Column(name = "bjxqId", nullable = false)
    public int getBjxqId() {
        return bjxqId;
    }

    public void setBjxqId(int bjxqId) {
        this.bjxqId = bjxqId;
    }

    @Basic
    @Column(name = "lxfs", nullable = true, length = 20)
    public String getLxfs() {
        return lxfs;
    }

    public void setLxfs(String lxfs) {
        this.lxfs = lxfs;
    }

    @Basic
    @Column(name = "jfsm", nullable = true, length = 100)
    public String getJfsm() {
        return jfsm;
    }

    public void setJfsm(String jfsm) {
        this.jfsm = jfsm;
    }

    @Basic
    @Column(name = "fksm", nullable = true, length = 100)
    public String getFksm() {
        return fksm;
    }

    public void setFksm(String fksm) {
        this.fksm = fksm;
    }

    @Basic
    @Column(name = "bzyssm", nullable = true, length = 100)
    public String getBzyssm() {
        return bzyssm;
    }

    public void setBzyssm(String bzyssm) {
        this.bzyssm = bzyssm;
    }

    @Basic
    @Column(name = "bz", nullable = true, length = 100)
    public String getBz() {
        return bz;
    }

    public void setBz(String bz) {
        this.bz = bz;
    }

    @Basic
    @Column(name = "spzt", nullable = true, length = 10)
    public String getSpzt() {
        return spzt;
    }

    public void setSpzt(String spzt) {
        this.spzt = spzt;
    }

    @Basic
    @Column(name = "spjl", nullable = true, length = 50)
    public String getSpjl() {
        return spjl;
    }

    public void setSpjl(String spjl) {
        this.spjl = spjl;
    }

    @Basic
    @Column(name = "fxs", nullable = true, length = 20)
    public String getFxs() {
        return fxs;
    }

    public void setFxs(String fxs) {
        this.fxs = fxs;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Bjxqinfo bjxqinfo = (Bjxqinfo) o;
        return bjxqId == bjxqinfo.bjxqId &&
                Objects.equals(lxfs, bjxqinfo.lxfs) &&
                Objects.equals(jfsm, bjxqinfo.jfsm) &&
                Objects.equals(fksm, bjxqinfo.fksm) &&
                Objects.equals(bzyssm, bjxqinfo.bzyssm) &&
                Objects.equals(bz, bjxqinfo.bz) &&
                Objects.equals(spzt, bjxqinfo.spzt) &&
                Objects.equals(spjl, bjxqinfo.spjl) &&
                Objects.equals(fxs, bjxqinfo.fxs);
    }

    @Override
    public int hashCode() {
        return Objects.hash(bjxqId, lxfs, jfsm, fksm, bzyssm, bz, spzt, spjl, fxs);
    }

    @OneToOne(mappedBy = "bjxq")
    public Bjinfo getBj() {
        return bj;
    }

    public void setBj(Bjinfo bj) {
        this.bj = bj;
    }

    @ManyToOne
    @JoinColumn(name = "jsrId", referencedColumnName = "contact_id")
    public Contact getJsr() {
        return jsr;
    }

    public void setJsr(Contact jsr) {
        this.jsr = jsr;
    }

    @ManyToOne
    @JoinColumn(name = "bjrId", referencedColumnName = "contact_id")
    public Contact getBjr() {
        return bjr;
    }

    public void setBjr(Contact bjr) {
        this.bjr = bjr;
    }
}
